package data

import "smoot-code/service/types"

// Data 数据层
type Data interface {
	GetName() string
	// GetTemplates 获取模板组
	GetTemplates() ([]types.Template, error)

	AddTemplate(types.Template) (string, error)

	EditTemplate(types.Template) (string, error)

	DeleteTemplate(types.Template) (string, error)

	CopyTemplate(types.Template) (string, error)

	GetTemplateFiles(dir string, key string) ([]types.FileInfo, error)

	GetConfigFiles(key string) ([]types.FileInfo, error)

	GetVarFiles(key string) ([]types.FileInfo, error)
	//
	EditFile(path string, content string) error
	//
	RenameFile(name string, newName string) error
	//
	NewFile(name string, isDir bool) error
	//
	DeleteFile(path string) error
}
